#include<stdio.h>
int main(){
    int i,k,n,m,sum;
    int count=0;
    scanf("%d",&n);
   m=n*n*n;
     for(i=1;i<=n*n*n;i+=2)
        {
         sum=0;
         count=0;
        for(k=i;k<=n*n*n;k++)
        {
            if(k%2!=0)
            {
            sum+=k;
            count++;
            }

        if(sum >= m)
            break;


        }
        if(sum == m)
            break;

       }

    printf("%d %d",i,count);

return 0;
}
